package com.eiokey.baselibrary.base.ui;

import androidx.lifecycle.ViewModel;

import com.eiokey.baselibrary.utils.BaseUtils;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.disposables.Disposable;

/**
 * description  基类vm,订阅
 * use
 * param
 * return
 * @author JetQiao
 * @date   2021/7/21  5:42 下午
 */
public class BaseViewModel extends ViewModel
{

    protected List<Disposable> disposables = new ArrayList<>();

    @Override
    protected void onCleared()
    {
        for (Disposable disposable : disposables)
        {
            BaseUtils.dispose(disposable);
        }
        super.onCleared();
    }
}
